<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/framework/web/common_web.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>乐驴网-用户信息</title>
</head>
<body>
	<table width="60%" align="center">
			<tr>
				<td colspan="2">
					<img src="<%=request.getContextPath()%>/framework/images/logo_new.jpg"/>|<span style="font-size: 20px">我的乐驴</span>|
					<span style="font-size: 12px"><a href="index.action">返回主页</a></span>
					<hr>
				</td>
			</tr>
			<tr height="400px" valign="top">
				<td class="keyword" width="20%">
					<ul>
						<li><a href="userZone.action?user.userId=<s:property value="#session['userId']"/>">个人资料</a></li>
						<li><a href="#">我的路线</a></li>
					</ul>
				</td>
				<td class="keyword" align="center">
					<table width="100%" class="articleBg" style="font-size: 12px">
						<tr>
							<td>路线名称</td>
							<td>出发时间</td>
							<td>结束时间</td>
							<td>目的地</td>
							<td>价格</td>
							<td>状态</td>
							<td>操作</td>
						</tr>
						<s:iterator value="preList">
						<tr>
							<td><s:property value="route.routeName"/> </td>
							<td><s:property value="route.routeStartDate"/> </td>
							<td><s:property value="route.routeEndDate"/> </td>
							<td><s:property value="route.routeDesc"/> </td>
							<td><s:property value="route.routePrice"/> </td>
							<td><Dict:DictInput dictKey="${payState}" dictField="PAY_STATE"/></td>
							<td>
								<s:if test="payState == 0">
									<a href="deleteRoutePreForUser.action?route.routeId=<s:property value="route.routeId"/>&user.userId=<s:property value="#session['userId']"/>">取消预定</a>|
								<a href="javascript:void(0)" uid="<s:property value="#session['userId']"/>" rpid="<s:property value="routePreId"/>" rprice="<s:property value="route.routePrice"/>" onclick="pay(this)">支付</a>
								</s:if>
								<s:else>
									无
								</s:else>
							</td>
						</tr>
						</s:iterator>
					</table>
				</td>
			</tr>
		</table>
		<script>
			function pay(obj){
				var uid = $(obj).attr("uid");
				var rpid = $(obj).attr("rpid");
				var rprice = $(obj).attr("rprice");
				$.post(
					"payRoutePre.action?user.userId="+uid+"&routePre.routePreId="+rpid+"&route.routePrice="+rprice,
					function(data){
						alert(data);
						location.reload();
					}
				);
			}
		</script>
		<%@ include file="/website/bottom.jsp" %>
</body>
</html>